﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace FTP_progress
{
    public partial class Login : Form
    {
        public Login()
        {
            InitializeComponent();
        }

        private void cancel_button_Click(object sender, EventArgs e)
        {
      
            if (MainForm.userName == "administrator")
            {
                MainForm.userName = "nobody";
            }
            this.Close();
        }

        private void Join_button_Click(object sender, EventArgs e)
        {
            if (user_name_comboBox.Text == "administrator" && password_textBox.Text == "pass-1234")
            {
                MainForm.userName = "administrator";
                this.Close();
            }
            else
            {
                MessageBox.Show("密码或用户名错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }

        private void Login_Load(object sender, EventArgs e)
        {

        }
    }
}
